<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数据备份 - 智慧题库</title>
    <link href="../assets/css/tailwind.css" rel="stylesheet">
    <link href="../assets/css/font-awesome.min.css" rel="stylesheet">
</head>
<body class="font-inter bg-gray-50 min-h-screen flex flex-col bg-education">
    <!-- 顶部导航栏 -->
    <header class="sticky top-0 z-50 bg-white/90 backdrop-blur-sm shadow-sm transition-all duration-300">
        <div class="container mx-auto px-4 py-3 flex items-center justify-between">
            <div class="flex items-center space-x-2">
                <div class="w-10 h-10 bg-primary/10 rounded-xl flex items-center justify-center text-primary">
                    <i class="fa fa-question-circle"></i>
                </div>
                <h1 class="text-xl font-bold text-dark ml-0 md:ml-[-2rem]">智慧题库管理系统</h1>
            </div>
            
            <!-- 顶部导航 -->
            <div class="hidden md:flex items-center space-x-2">
                <a href="AdminDashboard.html" class="nav-item">
                    <i class="fa fa-home mr-2"></i> 控制面板
                </a>
                <a href="QuestionManagement.html" class="nav-item">
                    <i class="fa fa-book mr-2"></i> 题库管理
                </a>
                <a href="ExamManagement.html" class="nav-item">
                    <i class="fa fa-graduation-cap mr-2"></i> 考试管理
                </a>
                <a href="TextbookVersionList.html" class="nav-item">
                    <i class="fa fa-archive mr-2"></i> 教材管理
                </a>
                <a href="StatisticsAnalysis.html" class="nav-item">
                    <i class="fa fa-bar-chart mr-2"></i> 数据分析
                </a>
                <a href="SystemSettings.html" class="nav-item active">
                    <i class="fa fa-cog mr-2"></i> 系统设置
                </a>
            </div>
            
            <div class="flex items-center space-x-4">
                <button class="p-2 text-muted hover:text-primary transition-colors relative">
                    <i class="fa fa-bell"></i>
                    <span class="absolute top-1 right-1 w-2 h-2 bg-accent rounded-full"></span>
                </button>
                <div class="flex items-center space-x-2">
                    <img src="https://picsum.photos/id/64/40/40" alt="用户头像" class="w-8 h-8 rounded-full object-cover border-2 border-primary/20">
                    <span class="hidden md:inline text-sm font-medium text-dark">张老师</span>
                    <i class="fa fa-angle-down text-muted"></i>
                </div>
                <button class="md:hidden p-2 text-muted hover:text-primary transition-colors" id="mobile-menu-button">
                    <i class="fa fa-bars"></i>
                </button>
            </div>
        </div>
    </header>

    <!-- 主内容区 -->
    <main class="flex-grow flex">
        <!-- 左侧导航栏 -->
        <aside id="sidebar" class="w-64 bg-sidebar-bg shadow-sidebar transition-all duration-300 h-[calc(100vh-64px)] sticky top-[64px] overflow-y-auto">
            <!-- 系统设置菜单 -->
            <div class="p-4 border-b border-gray-200">
                <h3 class="text-lg font-bold text-center text-muted uppercase tracking-wider">系统设置</h3>
            </div>
            <div class="p-2">
                <a href="SiteSettings.html" class="sidebar-item">
                    <i class="fa fa-globe"></i>
                    <span>站点设置</span>
                </a>
                <a href="RegisterSettings.html" class="sidebar-item">
                    <i class="fa fa-user-plus"></i>
                    <span>注册设置</span>
                </a>
                <a href="BasicSettings.html" class="sidebar-item">
                    <i class="fa fa-cog"></i>
                    <span>基础设置</span>
                </a>
                <a href="SecuritySettings.html" class="sidebar-item">
                    <i class="fa fa-shield"></i>
                    <span>安全设置</span>
                </a>
                <a href="RolePermissions.html" class="sidebar-item">
                    <i class="fa fa-users"></i>
                    <span>角色权限</span>
                </a>
                <div class="sidebar-item active">
                    <i class="fa fa-database"></i>
                    <span>数据备份</span>
                </div>
            </div>
        </aside>

        <!-- 内容区域 -->
        <div class="flex-grow p-6">
            <!-- 页面标题 -->
            <div class="mb-8">
                <div class="flex items-center justify-between">
                    <div>
                        <h2 class="text-[clamp(1.5rem,3vw,2rem)] font-bold text-dark">数据备份</h2>
                        <p class="text-muted mt-2">管理系统数据备份和恢复</p>
                    </div>
                    <div class="flex space-x-3">
                        <button class="px-4 py-2 bg-white border border-gray-300 text-dark rounded-lg shadow-sm hover:bg-gray-50 transition-colors">
                            <i class="fa fa-download mr-2"></i>立即备份
                        </button>
                        <button class="px-4 py-2 bg-primary text-white rounded-lg shadow-sm hover:bg-primary/90 transition-colors">
                            <i class="fa fa-save mr-2"></i>保存设置
                        </button>
                    </div>
                </div>
            </div>

            <!-- 备份状态概览 -->
            <div class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-8">
                <div class="stat-card rounded-2xl p-6 card-hover">
                    <div class="flex items-start justify-between">
                        <div>
                            <p class="text-muted text-sm">总备份数</p>
                            <h3 class="text-3xl font-bold text-dark mt-1">24</h3>
                            <p class="text-accent text-sm mt-2 flex items-center">
                                <i class="fa fa-arrow-up mr-1"></i> 较上月增长 8%
                            </p>
                        </div>
                        <div class="w-12 h-12 bg-primary/10 rounded-xl flex items-center justify-center text-primary">
                            <i class="fa fa-database text-xl"></i>
                        </div>
                    </div>
                </div>
                
                <div class="stat-card rounded-2xl p-6 card-hover">
                    <div class="flex items-start justify-between">
                        <div>
                            <p class="text-muted text-sm">成功备份</p>
                            <h3 class="text-3xl font-bold text-dark mt-1">22</h3>
                            <p class="text-accent text-sm mt-2 flex items-center">
                                <i class="fa fa-check mr-1"></i> 成功率 91.7%
                            </p>
                        </div>
                        <div class="w-12 h-12 bg-green-100 rounded-xl flex items-center justify-center text-green-600">
                            <i class="fa fa-check-circle text-xl"></i>
                        </div>
                    </div>
                </div>
                
                <div class="stat-card rounded-2xl p-6 card-hover">
                    <div class="flex items-start justify-between">
                        <div>
                            <p class="text-muted text-sm">失败备份</p>
                            <h3 class="text-3xl font-bold text-dark mt-1">2</h3>
                            <p class="text-red-500 text-sm mt-2 flex items-center">
                                <i class="fa fa-exclamation-triangle mr-1"></i> 需要处理
                            </p>
                        </div>
                        <div class="w-12 h-12 bg-red-100 rounded-xl flex items-center justify-center text-red-600">
                            <i class="fa fa-times-circle text-xl"></i>
                        </div>
                    </div>
                </div>
                
                <div class="stat-card rounded-2xl p-6 card-hover">
                    <div class="flex items-start justify-between">
                        <div>
                            <p class="text-muted text-sm">存储空间</p>
                            <h3 class="text-3xl font-bold text-dark mt-1">2.1GB</h3>
                            <p class="text-muted text-sm mt-2 flex items-center">
                                <i class="fa fa-hdd-o mr-1"></i> 剩余 8.9GB
                            </p>
                        </div>
                        <div class="w-12 h-12 bg-yellow-100 rounded-xl flex items-center justify-center text-yellow-600">
                            <i class="fa fa-hdd-o text-xl"></i>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 设置表单 -->
            <div class="space-y-6">
                <!-- 手动备份 -->
                <div class="bg-white rounded-2xl p-6 shadow-card">
                    <h3 class="text-lg font-bold text-dark mb-6 flex items-center">
                        <i class="fa fa-download text-primary mr-2"></i>手动备份
                    </h3>
                    
                    <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                        <div>
                            <h4 class="text-md font-medium text-dark mb-4">备份选项</h4>
                            <div class="space-y-4">
                                <label class="flex items-center">
                                    <input type="checkbox" checked class="mr-2">
                                    <span class="text-sm">用户数据</span>
                                </label>
                                <label class="flex items-center">
                                    <input type="checkbox" checked class="mr-2">
                                    <span class="text-sm">题库数据</span>
                                </label>
                                <label class="flex items-center">
                                    <input type="checkbox" checked class="mr-2">
                                    <span class="text-sm">考试数据</span>
                                </label>
                                <label class="flex items-center">
                                    <input type="checkbox" checked class="mr-2">
                                    <span class="text-sm">系统配置</span>
                                </label>
                                <label class="flex items-center">
                                    <input type="checkbox" class="mr-2">
                                    <span class="text-sm">日志文件</span>
                                </label>
                            </div>
                        </div>
                        
                        <div>
                            <h4 class="text-md font-medium text-dark mb-4">备份设置</h4>
                            <div class="space-y-4">
                                <div>
                                    <label class="block text-sm font-medium text-muted mb-1">备份名称</label>
                                    <input type="text" value="手动备份_2024-01-15" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/50">
                                </div>
                                <div>
                                    <label class="block text-sm font-medium text-muted mb-1">备份描述</label>
                                    <textarea class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/50" rows="3" placeholder="请输入备份描述..."></textarea>
                                </div>
                                <div>
                                    <label class="block text-sm font-medium text-muted mb-1">压缩格式</label>
                                    <select class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/50">
                                        <option>ZIP</option>
                                        <option>RAR</option>
                                        <option>7Z</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- 自动备份设置 -->
                <div class="bg-white rounded-2xl p-6 shadow-card">
                    <h3 class="text-lg font-bold text-dark mb-6 flex items-center">
                        <i class="fa fa-clock-o text-primary mr-2"></i>自动备份设置
                    </h3>
                    
                    <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                        <div>
                            <h4 class="text-md font-medium text-dark mb-4">备份计划</h4>
                            <div class="space-y-4">
                                <label class="flex items-center">
                                    <input type="checkbox" checked class="mr-2">
                                    <span class="text-sm">启用自动备份</span>
                                </label>
                                <div>
                                    <label class="block text-sm font-medium text-muted mb-1">备份频率</label>
                                    <select class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/50">
                                        <option>每天</option>
                                        <option>每周</option>
                                        <option>每月</option>
                                    </select>
                                </div>
                                <div>
                                    <label class="block text-sm font-medium text-muted mb-1">备份时间</label>
                                    <input type="time" value="02:00" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/50">
                                </div>
                                <div>
                                    <label class="block text-sm font-medium text-muted mb-1">保留备份数量</label>
                                    <input type="number" value="30" min="1" max="365" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/50">
                                </div>
                            </div>
                        </div>
                        
                        <div>
                            <h4 class="text-md font-medium text-dark mb-4">通知设置</h4>
                            <div class="space-y-4">
                                <label class="flex items-center">
                                    <input type="checkbox" checked class="mr-2">
                                    <span class="text-sm">备份成功通知</span>
                                </label>
                                <label class="flex items-center">
                                    <input type="checkbox" checked class="mr-2">
                                    <span class="text-sm">备份失败通知</span>
                                </label>
                                <label class="flex items-center">
                                    <input type="checkbox" class="mr-2">
                                    <span class="text-sm">存储空间不足通知</span>
                                </label>
                                <div>
                                    <label class="block text-sm font-medium text-muted mb-1">通知邮箱</label>
                                    <input type="email" value="admin@example.com" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/50">
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- 备份历史 -->
                <div class="bg-white rounded-2xl shadow-card">
                    <div class="p-6 border-b border-gray-200">
                        <h3 class="text-lg font-bold text-dark">备份历史</h3>
                    </div>
                    <div class="overflow-x-auto">
                        <table class="min-w-full divide-y divide-gray-200">
                            <thead class="bg-gray-50">
                                <tr>
                                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">备份名称</th>
                                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">类型</th>
                                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">大小</th>
                                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">状态</th>
                                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">创建时间</th>
                                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">操作</th>
                                </tr>
                            </thead>
                            <tbody class="bg-white divide-y divide-gray-200">
                                <tr>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-dark">自动备份_2024-01-15</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-muted">自动</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-dark">156MB</td>
                                    <td class="px-6 py-4 whitespace-nowrap">
                                        <span class="inline-flex px-2 py-1 text-xs font-semibold rounded-full bg-green-100 text-green-800">成功</span>
                                    </td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-muted">2024-01-15 02:00</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
                                        <button class="text-primary hover:text-primary/80 mr-3">
                                            <i class="fa fa-download"></i> 下载
                                        </button>
                                        <button class="text-green-600 hover:text-green-700 mr-3">
                                            <i class="fa fa-undo"></i> 恢复
                                        </button>
                                        <button class="text-red-500 hover:text-red-600">
                                            <i class="fa fa-trash"></i> 删除
                                        </button>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-dark">手动备份_2024-01-14</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-muted">手动</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-dark">142MB</td>
                                    <td class="px-6 py-4 whitespace-nowrap">
                                        <span class="inline-flex px-2 py-1 text-xs font-semibold rounded-full bg-green-100 text-green-800">成功</span>
                                    </td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-muted">2024-01-14 15:30</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
                                        <button class="text-primary hover:text-primary/80 mr-3">
                                            <i class="fa fa-download"></i> 下载
                                        </button>
                                        <button class="text-green-600 hover:text-green-700 mr-3">
                                            <i class="fa fa-undo"></i> 恢复
                                        </button>
                                        <button class="text-red-500 hover:text-red-600">
                                            <i class="fa fa-trash"></i> 删除
                                        </button>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-dark">自动备份_2024-01-14</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-muted">自动</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-dark">--</td>
                                    <td class="px-6 py-4 whitespace-nowrap">
                                        <span class="inline-flex px-2 py-1 text-xs font-semibold rounded-full bg-red-100 text-red-800">失败</span>
                                    </td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-muted">2024-01-14 02:00</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
                                        <button class="text-primary hover:text-primary/80 mr-3">
                                            <i class="fa fa-refresh"></i> 重试
                                        </button>
                                        <button class="text-red-500 hover:text-red-600">
                                            <i class="fa fa-trash"></i> 删除
                                        </button>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-dark">自动备份_2024-01-13</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-muted">自动</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-dark">148MB</td>
                                    <td class="px-6 py-4 whitespace-nowrap">
                                        <span class="inline-flex px-2 py-1 text-xs font-semibold rounded-full bg-green-100 text-green-800">成功</span>
                                    </td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm text-muted">2024-01-13 02:00</td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
                                        <button class="text-primary hover:text-primary/80 mr-3">
                                            <i class="fa fa-download"></i> 下载
                                        </button>
                                        <button class="text-green-600 hover:text-green-700 mr-3">
                                            <i class="fa fa-undo"></i> 恢复
                                        </button>
                                        <button class="text-red-500 hover:text-red-600">
                                            <i class="fa fa-trash"></i> 删除
                                        </button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </main>
</div>

<!-- 引入公共样式和脚本 -->
<link rel="stylesheet" href="../css/admin-styles.css">
<script src="../js/admin-scripts.js"></script> 
<script src="../js/admin-scripts.js"></script> 